home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2009 February / PCWFEB09.iso / Software / Resources / Chat & Communication / Digsby build 37 / digsby_setup.exe / lib / PIL / ImageEnhance.pyo (.txt) < prev    next >
Python Compiled Bytecode  |  2008-10-13  |  2KB  |  46 lines

  1. # Source Generated with Decompyle++
  2. # File: in.pyo (Python 2.5)
  3.  
  4. import Image
  5. import ImageFilter
  6.  
  7. class _Enhance:
  8.     
  9.     def enhance(self, factor):
  10.         return Image.blend(self.degenerate, self.image, factor)
  11.  
  12.  
  13.  
  14. class Color(_Enhance):
  15.     
  16.     def __init__(self, image):
  17.         self.image = image
  18.         self.degenerate = image.convert('L').convert(image.mode)
  19.  
  20.  
  21.  
  22. class Contrast(_Enhance):
  23.     
  24.     def __init__(self, image):
  25.         self.image = image
  26.         mean = reduce((lambda a, b: a + b), image.convert('L').histogram()) / 256
  27.         self.degenerate = Image.new('L', image.size, mean).convert(image.mode)
  28.  
  29.  
  30.  
  31. class Brightness(_Enhance):
  32.     
  33.     def __init__(self, image):
  34.         self.image = image
  35.         self.degenerate = Image.new(image.mode, image.size, 0)
  36.  
  37.  
  38.  
  39. class Sharpness(_Enhance):
  40.     
  41.     def __init__(self, image):
  42.         self.image = image
  43.         self.degenerate = image.filter(ImageFilter.SMOOTH)
  44.  
  45.  
  46.